feat(provenance): v2 per-function code-byte ranges (#143 DWARF Phase 2 inc 1)#200
Merged
Merged
Conversation
…2 inc 1)
First increment of DWARF Phase 2 (address remap). Extends the
component-provenance custom section to v2: each entry gains an
optional code_range { start, end } giving the function body's byte
span in the fused code section, rebased to the code-section content
start (the WebAssembly-DWARF code-section-relative address
convention). Anchor for every later DWARF remap step.
- provenance::CodeRange + Entry::code_range: Option<_>
(serde default + skip_serializing_if)
- provenance::code_section_function_ranges re-parses the output
code section, rebasing each FunctionBody range to
CodeSectionStart.range.start
- build() index-aligns ranges with merged.functions
- VERSION 1->2, additive: v1-shaped entries round-trip unchanged
Tests: 5 unit + 1 integration. 291 lib tests green, clippy clean
(verified before commit). LS-M-6 updated with v2 surface + residual.
Scope: accurate current byte spans. .debug_line remapping inside
rewritten functions deferred to increment 2 (rewriter offset map) +
increment 3 (gimli rewrite).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
LS-N verification gate
Approved Failed LS entries(none) Missing regression tests
Updated automatically by |
Mythos delta-pass (auto)✅ NO FINDINGS across 1 Tier-5 file(s)
Auto-run via |
avrabe
added a commit
that referenced
this pull request
May 28, 2026
DWARF Phase 2 increment 1 (#143, #200): component-provenance section v2 with per-function code-byte ranges — the anchor for DWARF address remapping. Plus the LS-M-5 status correction (#199, already-mitigated multiply-instantiated-module hazard). Increments 2 (rewriter instruction-offset map) and 3 (gimli DWARF rewrite) follow in later releases. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First increment of #143 DWARF Phase 2 (address remap). Extends the
component-provenancecustom section to v2: each entry gains an optionalcode_range { start, end }giving the function body's byte span in the fused code section, rebased to the code-section content start (the WebAssembly-DWARF code-section-relative address convention). This is the anchor every later DWARF remap step builds on.User-authorized path: extend #192 to v2 + full-correctness DWARF. gimli enters in increment 3.
Changes
provenance::CodeRangestruct +Entry::code_range: Option<CodeRange>(#[serde(default, skip_serializing_if = "Option::is_none")])provenance::code_section_function_ranges(module_bytes)— re-parses the output code section via wasmparser, rebasing eachFunctionBody::range()toCodeSectionStart.range.startbuild()index-aligns ranges withmerged.functions(meld emits merged functions before adapter trampolines, so positioni↔merged.functions[i])VERSION1 → 2, additive: v1-shaped entries (nocode_rangekey) round-trip unchanged; v1 consumers that checkversionfirst still parse the entriesScope (honest)
Delivers accurate current byte spans. DWARF
.debug_lineremapping inside rewritten functions is NOT in this PR — meld's rewriter shifts intra-function offsets via LEB128 operand-length changes, which needs:.debug_info+.debug_lineusing both mapsTest plan
v2_code_ranges_are_populated_ordered_and_nonoverlapping) against the real fused fixtureprovenance.rs(Tier-5)🤖 Generated with Claude Code